package com.example.demo.service;

import cn.hutool.db.Page;
import com.example.demo.entity.user;
import com.example.demo.mapper.superusermapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class superuserservice implements superuserserviceInter{
    @Autowired
    superusermapper superuserdao;

    public user getauthorityid(user u) {
        return superuserdao.getauthorityid(u);
    }

    public PageInfo<user> getusers(Integer pagenum, Integer pagesize) {
        PageHelper.startPage(pagenum, pagesize);
        List<user> list = superuserdao.getusers();
        PageInfo<user> pageinfo = new PageInfo<>(list);

        return pageinfo;
    }
    public user searchuser(user u) {
        return superuserdao.searchuser(u);
    }
    public int updateuser(user u) {
        return superuserdao.updateuser(u);
    }
    public user searchid(user u) {
        return superuserdao.searchid(u);
    }
}
